﻿using Belmost4PDA.Fasade;

namespace Belmost4PDA.Logic
{
    public abstract class Mapper_WithController:AbstractMapper
    {
        public Mapper_WithController(PanelItem panelItem)
        {
            // setup controller
            valueController =
                AbstractValueController.GetController((AbstractValueController.ControllerType) panelItem.valType,
                                                      panelItem);
        }

        protected readonly AbstractValueController valueController = new ControllerNoControl();
        protected abstract string CurrentValue(); // дает текущее значение в контроле
        public override bool CheckValue()
        {
            return valueController.Check(CurrentValue());
        }
        public override string GetDefValue()
        {
            return valueController.DefaultValue();
        }

    }
}
